package io.github.linpeilie;

import io.github.linpeilie.model.*;

import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class StartUp {

    private Converter converter;

    @Autowired
    public void setConverter(final Converter converter) {
        this.converter = converter;
    }

    @PostConstruct
    public void start() {
        BookInput bookInput = new BookInput();
        bookInput.setId(1L);
//        bookInput.setStoreId(1L);
        Book convert = converter.convert(bookInput, Book.class);
        System.out.println(convert);
        BookInput bookInput1 = converter.convert(convert, BookInput.class);
        System.out.println("uuuuuuuuuuu");
        System.out.println(bookInput1);

    }

}
